import React from "react";
import {Input, InputNumber, Switch} from "antd";
import TextArea from "antd/es/input/TextArea";

/**
 * 表单输入类型映射Map
 */
export const inputTypeMap = new Map<string, string>() ;
inputTypeMap.set("item","text") ;
inputTypeMap.set("order","number") ;
inputTypeMap.set("show","boolean");
inputTypeMap.set("explain","text");
inputTypeMap.set("remark","area");

/**
 * 表单输入组件映射Map ,根据key获取对应表单输入组件的组件
 */
export const inputMap = new Map<string, React.ReactNode>();
inputMap.set("number", <InputNumber min={0}/>);
inputMap.set("text", <Input />);
inputMap.set("boolean", <Switch />);
inputMap.set("area", <TextArea rows={2}/>);

